package com.naiterui.ehp.bs.recommend.service;


import java.util.List;
import java.util.Set;

import com.naiterui.ehp.bp.bo.doctor.RecomUserInfoBO;
import com.naiterui.ehp.bp.bo.emr.MedicalRecordBO;
import com.naiterui.ehp.bp.bo.emr.MedicalRecordDoctorBO;
import com.naiterui.ehp.bp.bo.im.DoctorsMedicalRecordBO;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.recommend.bean.DrMedicationRecomInfo;
import com.naiterui.ehp.bs.recommend.bean.MedicationRecom;
import com.naiterui.ehp.bs.recommend.bean.RecomPrescription;
import com.naiterui.ehp.bs.recommend.vo.RecomResultVO;
import com.naiterui.ehp.bs.recommend.vo.RecomVO;
import com.naiterui.ehp.bs.recommend.vo.esign.ywx.PreSignResultVO;
import com.naiterui.ehp.bs.recommend.vo.param.RecomItemParamVO;
import com.naiterui.ehp.bs.recommend.vo.param.RecomParamVO;

public interface IRecomCreaterService {

    /**
     * 保存推荐单
     * RecomServiceImpl.saveRecom()
     *
     * @param doctorId
     * @param vo
     *
     * @return
     *
     * @throws BusinessException
     * @Author guoyongxiang
     * @Date 2017年8月1日
     * @since 2.9.0
     */
    RecomVO saveRecom(Long doctorId, RecomParamVO vo, Integer requestFrom) throws BusinessException;

    /**
     * 发送推荐
     * IRecomCreaterService.saveRecomConfirm()
     *
     * @param doctorId
     * @param recomId
     * @param force
     *
     * @return
     *
     * @throws BusinessException
     * @Author guoyongxiang
     * @Date 2017年8月8日
     * @since 2.9.0
     */
    RecomResultVO saveRecomConfirm(Long doctorId, Long recomId, Boolean force,Integer consultType, Long consultId, String recordId, String uniqueId) throws BusinessException;


    /**
     * 构建处方病例对象
     * IRecomCreaterService.buildSyncMedicalRecordBO()
     *
     * @param recomInfo
     *
     * @return
     *
     * @Date 2018年6月4日
     * @since 2.18
     */
    MedicalRecordBO buildSyncMedicalRecordBO(DrMedicationRecomInfo recomInfo, MedicationRecom recom);

    /**
     * 构建病历消息
     * IRecomCreaterService.buildRecordMessage()
     *
     * @param messageBO
     * @param bo
     *
     * @Author lichaopi
     * @Date 2018年6月29日
     * @since 1.0.0
     */
    void buildRecordMessage(DoctorsMedicalRecordBO messageBO, MedicalRecordDoctorBO bo);

    /**
     * 获取医生科室信息
     *
     * @param userInfo       医生信息
     *
     * @return
     *
     * @throws BusinessException
     * @Author gongbaoqiang
     * @Date 2018年10月16日
     * @Version 3.4.0
     */
    String getDepartmentName(RecomUserInfoBO userInfo) throws BusinessException;

    /**
     * * 生成并保存处方图
     *
     * @param hospitalName
     * @param recom
     * @param info
     * @param details
     * @param requestFrom
     *
     * @return
     */
    List<PreSignResultVO> savePrescriptionFile(String hospitalName, MedicationRecom recom, DrMedicationRecomInfo info,
        List<RecomItemParamVO> details, Integer requestFrom);

    /**
     * 保存处方文件
     *
     * @param name
     * @param path
     * @param recomId
     * @param type
     */
    void savePrescriptionFile(String name, String path, Long recomId, Integer type);

    /**
     * 根据处方ID & 类型获取处方图信息
     *
     * @param recomId
     * @param type
     *
     * @return
     */
    RecomPrescription getByRecomIdAndType(Long recomId, Integer type);

    /**
     * 校验处方发送权限
     *
     * @param doctorId
     *
     * @throws BusinessExceptipdfon
     */
    void verifyRecomLimit(Long doctorId, Long inquirerId) throws BusinessException;

    /**
     * 重生成处方PDF
     *
     * @param recomIdList
     *
     * @return
     */
    List<String> generateRecomPdf(String hospitalName, Set<Long> recomIdSet);
}
